package org.uned.agonzalo16.bitacora.web.user;

import org.hibernate.validator.constraints.NotBlank;
import org.uned.agonzalo16.bitacora.domain.User;
import org.uned.agonzalo16.bitacora.web.validation.IsMail;

public class UserForm {

	private Long id;

	@NotBlank
	@IsMail
	private String email;

	@NotBlank
	private String username;

	private String password;

	private String localization;

	private String webSite;

	private int type;

	private boolean active;

	public UserForm() {
		type = 2;
	}

	public UserForm(User user) {
		id = user.getId();
		email = user.getEmail();
		username = user.getUsername();
		password = user.getPassword();
		localization = user.getLocalization();
		webSite = user.getWebSite();
		type = user.getType();
		active = user.isActive();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getLocalization() {
		return localization;
	}

	public void setLocalization(String localization) {
		this.localization = localization;
	}

	public String getWebSite() {
		return webSite;
	}

	public void setWebSite(String webSite) {
		this.webSite = webSite;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
}
